package com.ruoyi.dynamic.controller.app;


import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.annotation.AnonymousAccess;
import com.ruoyi.common.core.constant.constant.PathConstant;
import com.ruoyi.dynamic.model.pojo.request.sheng.AppShengWebHookRequest;
import com.ruoyi.dynamic.service.IRoomService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "App-声网webHoom回调相关", description = "App-声网webHoom回调相关")
@RestController
@RequestMapping(PathConstant.APP_PATH + "message")
public class AppMessageController {


    @Autowired
    private IRoomService iRoomService;


    @AnonymousAccess
    @Operation(summary = "收到声网回调", description = "收到声网回调")
    @PostMapping
    public JSONObject create(@RequestBody AppShengWebHookRequest request,@RequestHeader("Agora-Signature-V2")String sign) {
        return iRoomService.webHookMessage(request,sign);
    }

}

